home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / amicad / arexx_english / editscript.amicad < prev    next >
Text File  |  1998-05-24  |  1KB  |  46 lines

  1. /* EditScript.AmiCAD, Version 1.00e © R.Florac */
  2. /* This script is called for loading a script file in a text editor while working with AmiCAD */
  3. /* Push the CONTROL key while selecting an ARexx menu with AmiCAD
  4.  * to call it. The script must be in the AmiCAD/ARexx directory and
  5.  * must have the .AmiCAD extension to his name.
  6.  * This script is for my text editor Amitex, adapt it
  7.  * to any other text editor to suit to your needs. */
  8.  
  9. parse arg script            /* reads the script name */
  10. if script = "" then exit
  11.  
  12. signal on error             /* for intercepting the errors */
  13. signal on syntax
  14.  
  15. options results
  16.  
  17. port = ADDRESS()                    /* reads the name of AmiCAD ARexx port */
  18.  
  19. address command
  20. if ~show(p, "AMITEX") then do       /* could be better (AMITEX0, AMITEX1...) */
  21.     f=0                 /* No window allready opened */
  22.     'run > nil:' "c:AmiTex"         /* loading the editor */
  23.     waitforport "AMITEX"
  24. end
  25. else f=1                /* the editor was allready running */
  26.  
  27. ADDRESS (AMITEX)
  28. cr='0a'x
  29.  
  30. if f=1 then 'NEW("")'               /* ask for opening a new window */
  31. 'LOAD("'script'.AmiCAD")'           /* loads the script file */
  32.  
  33. exit
  34.  
  35. /* Traitement des erreurs, interruption du programme */
  36. syntax:
  37. address (port)
  38. erreur=RC
  39. 'MESSAGE("Script EditScript.AmiCAD :"+CHR(10)+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  40. exit
  41.  
  42. error:
  43. address (port)
  44. 'MESSAGE("Script EditScript.AmiCAD :"+CHR(10)+"Error in line 'SIGL'")'
  45. exit
  46.